<table class="table">
    <thead>
        <tr>
            <th *ngIf="checkBox">
                <input type='checkbox' [(ngModel)]='allSelect' (ngModelChange)="allSelectCheck()">
            </th>
            <th class="table-title" [style.width]="header.width" *ngFor="let header of headers" title="{{header.title}}" [ngClass]="{canSort:header.canSort}"
                (click)="sort(header)">
                <div class="table-title-th text-over-flow">
                    {{header.title}}
                    <div [ngClass]="{'sort':nowSort.field==header.field && nowSort.sort=='asc','sort-desc':nowSort.field==header.field && nowSort.sort=='desc'}"
                        (click)="sort(header)"></div>
                </div>
            </th>
        </tr>
    </thead>

    <tbody>
        <tr *ngFor="let data of datas let i = index">
            <td *ngIf="checkBox">
                <input type='checkbox' [(ngModel)]='checks[i]' (ngModelChange)="checkSelect()">
            </td>
            <td *ngFor="let header of headers">
                <ng-container [ngTemplateOutlet]="template" [ngTemplateOutletContext]="{
                    $implicit: {
                      d: data,
                      h: header
                    }}"></ng-container>
            </td>
        </tr>
    </tbody>
</table>